/**
 * @Time    : 2022/03/02 11:39:17
 * @Author  : WanRongJia
 * @License : Software business license
 * @Site    : www.linshensjl.top
 * @File    : index.js
 * @Software: Rich Web Platform
 * @Function: 全局组件注册
 * @Version : 1.0
 **/
import {defineAsyncComponent} from 'vue';

const componentsName = import.meta.globEager('./home/atom/*.vue');
const components = import.meta.glob('./home/atom/*.vue');

export default function (app) {
    for (const [key, value] of Object.entries(components)) {
        // 注册组件名字   没有抛出Name， 引用文件组件文件夹名字
        const name = componentsName[key].default.name || key.slice(31, key.lastIndexOf('/'));
        if (name.includes('jRow')) continue
        app.component(name, defineAsyncComponent(value));
        console.log(name)
    }
}
